package mornd.simpleurlhandlermapping;

import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import java.util.Map;

/**
 * @author: mornd
 * @dateTime: 2023/5/9 - 21:52
 * 处理静态资源文件 （/**  /img/**）
 * SimpleUrlHandlerMapping 和 HttpRequestHandlerAdapter
 * 映射器：SimpleUrlHandlerMapping
 * 处理器：HttpRequestHandler
 * 适配器：HttpRequestHandlerAdapter
 */
public class App {
    public static void main(String[] args) {
        AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext(WebConfig.class);
        SimpleUrlHandlerMapping handlerMapping = context.getBean(SimpleUrlHandlerMapping.class);
        Map<String, Object> handlerMap = handlerMapping.getHandlerMap();
        System.out.println("==>" + handlerMap);
    }
}
